{% extends 'base.html' %}

{% block body %}
<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Oldboy PefectCRMlll</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">

        <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">{{ request.user.name }} <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">配置</a></li>
                <li><a href="{% url 'acc_logout' %}">注销</a></li>
              </ul>
        </li>

      </ul>

    </div>
  </div>
</nav>

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-3 col-md-2 sidebar">
      <ul class="nav nav-sidebar">
        {% for  role in request.user.roles.all %}
          {% for menu in role.menus.all %}
            <li class=""><a href="{% if menu.url_type == 0 %}{%  url  menu.url_name %} {% else %}{{ menu.url_name }}{% endif %}">{{ menu.name }}</a></li>
          {% endfor %}
        {% endfor %}

      </ul>

    </div>
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
     {% block page-content %}
      <h1 class="page-header">Dashboard</h1>

      <div class="row placeholders">
        <div class="col-xs-6 col-sm-3 placeholder">
          <img data-src="holder.js/200x200/auto/sky" class="img-responsive" alt="200x200" src="" data-holder-rendered="true">
          <h4>Label</h4>
          <span class="text-muted">Something else</span>
        </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <img data-src="holder.js/200x200/auto/vine" class="img-responsive" alt="200x200" src="" data-holder-rendered="true">
          <h4>Label</h4>
          <span class="text-muted">Something else</span>
        </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <img data-src="holder.js/200x200/auto/sky" class="img-responsive" alt="200x200" src="" data-holder-rendered="true">
          <h4>Label</h4>
          <span class="text-muted">Something else</span>
        </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <img data-src="holder.js/200x200/auto/vine" class="img-responsive" alt="200x200" src="" data-holder-rendered="true">
          <h4>Label</h4>
          <span class="text-muted">Something else</span>
        </div>
      </div>

      <h2 class="sub-header">Section title</h2>

     {% endblock %}
    </div>
  </div>
</div>



</body>

{% endblock %}